﻿using ITSM.Model.Entity;
using ITSM.Model.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ITSM.Service
{
    public interface IUserInfo
    {
        /// <summary>
        /// 根据微信id获取用户id
        /// </summary>
        /// <param name="wid">微信id</param>
        /// <returns></returns>
        string QueryUserId(string RYD_Id);

        /// <summary>
        /// 根据id获取用户表数据
        /// </summary>
        /// <param name="rid">瑞德用户id</param>
        /// <returns></returns>
        RYD_UserInfo QueryUserInfo(string RYD_Id);

        /// <summary>
        /// 根据WxNo微信id，注册用户
        /// </summary>
        /// <param name="RYD_WxNo">微信id</param>
        /// <returns></returns>
        string RegUser(string RYD_WxNo,int type);

        /// <summary>
        /// 根据RydNo工号查找用户Id
        /// </summary>
        /// <param name="RYD_RydNo">ryd工号</param>
        /// <returns></returns>
        string RydNoQueryUserId(string RYD_RyderNo);

        /// <summary>
        /// 向HR供应商提供的接口查询工号和身份证后六位是否匹配，匹配则修改用户的RydNo
        /// </summary>
        /// <param name="RYD_RydNo"></param>
        /// <param name="ID"></param>
        /// <returns></returns>
        Task<bool> InspectRydNoAsync(RYD_InspectRydNo inspectRydNo);

        /// <summary>
        /// IT人员注册，修改UserInfo表中人员信息，将State字段修改为2
        /// </summary>
        /// <param name="regIt"></param>
        /// <returns></returns>
        RYD_RegIt RegIt(RYD_RegIt regIt);

        /// <summary>
        /// 修改IT用户资料
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        bool UpdateUserInfo(RYD_UserInfo userInfo);

        /// <summary>
        /// 根据用户Id获取所在公司
        /// </summary>
        /// <returns></returns>
        string GetCompanyUser(string RYD_UserId);

        /// <summary>
        /// 根据用户Id获取用户角色
        /// </summary>
        /// <returns></returns>
        int GetStateUser(string RYD_UserId);

        /// <summary>
        /// (使用微信接口)根据微信授权的Code查询用户OpenId
        /// </summary>
        /// <returns></returns>
        Task<string> OAuth2(string code);

        /// <summary>
        /// (查询数据库)根据微信授权的Code查询用户OpenId
        /// </summary>
        /// <returns></returns>
        string GetOpenId(string code);
        /// <summary>
        /// 根据类别绑定信息查询IT人员信息
        /// </summary>
        /// <param name="demandTypeLinks"></param>
        /// <returns></returns>
        List<RYD_UserInfo> GetUserInfo(List<RYD_DemandTypeLink> demandTypeLinks);

        List<RYD_UserInfo> GetAllItName(string Company);

        List<RYD_UserInfo> GetAllName(string[] ids);

        /// <summary>
        /// 更新用户微信Code
        /// </summary>
        /// <returns></returns>
        bool UpdateWxCode(string code,string userId);
    }
}
